<?php
require_once ('Stencil.php');
output_frame_header ( '找回密码成功' );
$u_name = $_POST ['u_name'];
$ask = $_POST ['ask'];
$answer = $_POST ['answer'];

require ('dbconnect.php');
$query = "SELECT password FROM user WHERE name='$u_name' AND s_question='$ask' AND s_answer='$answer'";
//echo $query;
$result = mysql_query ( $query );

if( mysql_num_rows( $result ))
{
$password = mysql_fetch_array ( $result );
echo <<<ROD
  <div class="loginBox lh20" style="height:450px;">
  <div>
    <div class="space" style="text-align:center"></div>
		<img src="./images/get password5.png" alt="" width="900" height="75"
					border="0" align="center">
    </div>
			<table width="732px" cellspacing="0" cellpadding="0" border="0" style="margin-left:300px; color:#5E5E5E;font-size:14px;">

			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td align="right"><img width="120px" src="images/logo1.jpg"></td>
				<td><font color="#006030" size="4px" ><B>请妥善保管好您的密码</B></font></td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr class="nameShow">
				<td width="130" height="35"><font
					size="3px">志愿者账号</font></td>
				<td>{$_POST['u_name']}</td>
			</tr>

			<tr class="nameShow">
				<td width="130" height="35" class="u_blue bold">
					<font size="3px">您的密码</font>
				</td>
				<td>{$password['password']}</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
          </table>
          <div width="300px" align="center">
				<a href="./index.php"><img
					src="images/affirm.jpg" width="60" height="25"></a>
          </div>
  </div>
ROD;
}else{ echo ("<script type='text/javascript'> alert('用户名不存在或问题回答错误!'); /**/location.href='getbackpassword_answer.php';</script>");
}
output_frame_footer ();
?>